<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>1€ filter for Arduino: OneEuroFilter Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">1€ filter for Arduino<span id="projectnumber">&#160;1.0.0</span>
   </div>
   <div id="projectbrief">Algorithm to filter noisy signals for high precision and responsiveness.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">OneEuroFilter Class Reference</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3249f684680b9f004d46b0e456e391fe"><td class="memItemLeft" align="right" valign="top"><a id="a3249f684680b9f004d46b0e456e391fe" name="a3249f684680b9f004d46b0e456e391fe"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>OneEuroFilter</b> (float freq=DEFAULT_FREQUENCY, float mincutoff=DEFAULT_MINCUTOFF, float beta_=DEFAULT_BETA, float dcutoff=DEFAULT_DCUTOFF)</td></tr>
<tr class="separator:a3249f684680b9f004d46b0e456e391fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8eb5abcd35e41987a5cd0d87983790a2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_one_euro_filter.html#a8eb5abcd35e41987a5cd0d87983790a2">begin</a> (float freq, float mincutoff=1.0, float beta_=0.0, float dcutoff=1.0)</td></tr>
<tr class="memdesc:a8eb5abcd35e41987a5cd0d87983790a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates the filter and set its parameters.  <br /></td></tr>
<tr class="separator:a8eb5abcd35e41987a5cd0d87983790a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2b89e7b9f5d6d7f5477b068288ccb8f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_one_euro_filter.html#ac2b89e7b9f5d6d7f5477b068288ccb8f">setFrequency</a> (float f)</td></tr>
<tr class="memdesc:ac2b89e7b9f5d6d7f5477b068288ccb8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the frequency of the signal.  <br /></td></tr>
<tr class="separator:ac2b89e7b9f5d6d7f5477b068288ccb8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3155e00c9c8d3c426f466f2e06c5513c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_one_euro_filter.html#a3155e00c9c8d3c426f466f2e06c5513c">setMinCutoff</a> (float mc)</td></tr>
<tr class="memdesc:a3155e00c9c8d3c426f466f2e06c5513c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the filter min cutoff frequency.  <br /></td></tr>
<tr class="separator:a3155e00c9c8d3c426f466f2e06c5513c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa50a248ba2911f9c8d1a224013356339"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_one_euro_filter.html#aa50a248ba2911f9c8d1a224013356339">setBeta</a> (float b)</td></tr>
<tr class="memdesc:aa50a248ba2911f9c8d1a224013356339"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the Beta parameter.  <br /></td></tr>
<tr class="separator:aa50a248ba2911f9c8d1a224013356339"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace180addce61fae62866f19a27f65e46"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_one_euro_filter.html#ace180addce61fae62866f19a27f65e46">filter</a> (float value, TimeStamp timestamp=UndefinedTime)</td></tr>
<tr class="memdesc:ace180addce61fae62866f19a27f65e46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Filter the noisy signal.  <br /></td></tr>
<tr class="separator:ace180addce61fae62866f19a27f65e46"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a8eb5abcd35e41987a5cd0d87983790a2" name="a8eb5abcd35e41987a5cd0d87983790a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8eb5abcd35e41987a5cd0d87983790a2">&#9670;&#160;</a></span>begin()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void OneEuroFilter::begin </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>mincutoff</em> = <code>1.0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>beta_</em> = <code>0.0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>dcutoff</em> = <code>1.0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates the filter and set its parameters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">freq</td><td>An estimate of the frequency in Hz of the signal (&gt; 0), if timestamps are not available. </td></tr>
    <tr><td class="paramname">mincutoff</td><td>Min cutoff frequency in Hz (&gt; 0). Lower values allow to remove more jitter. </td></tr>
    <tr><td class="paramname">beta_</td><td>Parameter to reduce latency (&gt; 0). </td></tr>
    <tr><td class="paramname">dcutoff</td><td>Used to filter the derivates. 1 Hz by default. Change this parameter if you know what you are doing. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ace180addce61fae62866f19a27f65e46" name="ace180addce61fae62866f19a27f65e46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace180addce61fae62866f19a27f65e46">&#9670;&#160;</a></span>filter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float OneEuroFilter::filter </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TimeStamp&#160;</td>
          <td class="paramname"><em>timestamp</em> = <code>UndefinedTime</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Filter the noisy signal. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>Noisy value to filter </td></tr>
    <tr><td class="paramname">timestamp</td><td>(optional) timestamp in seconds </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The filtered value </dd></dl>

</div>
</div>
<a id="aa50a248ba2911f9c8d1a224013356339" name="aa50a248ba2911f9c8d1a224013356339"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa50a248ba2911f9c8d1a224013356339">&#9670;&#160;</a></span>setBeta()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void OneEuroFilter::setBeta </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the Beta parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">b</td><td>Parameter to reduce latency (&gt; 0). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ac2b89e7b9f5d6d7f5477b068288ccb8f" name="ac2b89e7b9f5d6d7f5477b068288ccb8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2b89e7b9f5d6d7f5477b068288ccb8f">&#9670;&#160;</a></span>setFrequency()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void OneEuroFilter::setFrequency </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the frequency of the signal. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>An estimate of the frequency in Hz of the signal (&gt; 0), if timestamps are not available. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3155e00c9c8d3c426f466f2e06c5513c" name="a3155e00c9c8d3c426f466f2e06c5513c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3155e00c9c8d3c426f466f2e06c5513c">&#9670;&#160;</a></span>setMinCutoff()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void OneEuroFilter::setMinCutoff </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>mc</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the filter min cutoff frequency. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mc</td><td>Min cutoff frequency in Hz (&gt; 0). Lower values allow to remove more jitter. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/<a class="el" href="1euro_filter_8h_source.html">1euroFilter.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6
</small></address>
</body>
</html>
